package controller.admin.workspace;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.VO.WorkSpaceVO;
import service.Impl.WorkSpaceServiceImpl;
import util.ResultUtil;

import java.io.IOException;

@WebServlet("/admin/workspace/data")
public class WorkSpaceController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        WorkSpaceServiceImpl workSpaceService=new WorkSpaceServiceImpl();
        WorkSpaceVO workSpaceVO=workSpaceService.getAll();
        String json= ResultUtil.getJSON(workSpaceVO);
        resp.getWriter().write(json);
    }
}
